import re, sys, os, urllib2, time
from traceback import format_exc

for line in open('cet6.word'):
    try:
        #line = unicode(line, 'cp936')
        word = re.search('(\w+)', line).group(1)
        ilen = len(word)
        url = 'http://127.0.0.1:8002/setcet6term/%s_%s' %(word, line[ilen + 1:])
        #print(url)
        urllib2.urlopen(url).read()
        #time.sleep(1)
        #urllib2.urlopen()
    except:
        print url, format_exc()
    
